'use client'
import './style.css';
import React from 'react';
import { useRouter,usePathname } from 'next/navigation'
import routeData from '../../lib/route';
const App: React.FC = () => {

 const router = useRouter()

const logout = ()=>{
	
}
const backTitle = (p)=>{
	
}
const ischeck =(py:String)=>{
	let p = usePathname()
	return p===py?'check':''
}
const list = routeData
const listItems = list.map((item,index) => {
	
	return <li  key={index+item.path} onClick={()=>{
		
		router.push(item.path)
	}} className={ischeck(item.path)}>
	    <div  className="lefnav_03">	       
	        <p>{ item.label }</p>   
	    </div>
	</li>
	
});
  return <>
   <div className="lefnav_0box">
       <img className="lefnav_01" src="/image/1/1.png"/>
       <ul className="lefnav_02">
           {listItems}
       </ul>
       <div onClick={()=>{
		   window.islogin = ''
		   sessionStorage.setItem('islogin','')
		   router.push('/login')
	   }} className="lefnav_04">退出</div>
   </div>
 </>
}


export default App;